import http from '@/tool/http'
//角色列表请求
export const getRoles = () => http.get('roles')
//角色授权
export const authorization = (roleId, obj) => http.post(`roles/${roleId}/rights`, obj)
//添加用户
export const add = (obj) => http.post(`roles`, obj)
//删除权限
export const del = (roleId, rightId) => http.delete(`roles/${roleId}/rights/${rightId}`)
//删除角色
export const delline = (id) => http.delete(`roles/${id}`)
//分配用户角色
export const assigns = (id, rid) => http.put(`users/${id}/role`, { rid })
//编辑角色
export const edit = (id, obj) => http.put(`roles/${id}`, obj)
